<template>
    <div>
        <div class="bjtk">
            <div class="bjtk_list">
                <div class="head">
                    <span></span>
                    <a-button class="editable-add-btn" @click="close">
                        <a-icon type="close"/>
                    </a-button>

                </div>
                <a-table
                        :loading="loading"
                        :pagination='false'
                        :dataSource="data"
                        :columns="columns"
                >
                    <template v-for="titletext in []" :slot="titletext" slot-scope="text,record,index">
                        <div :key="titletext"></div>
                    </template>
                </a-table>
            </div>
        </div>
    </div>
</template>

<script>
    import qs from "qs";
    const columns = [
        {
            title: "型号",
            dataIndex: "gg",
        },
        {
            title: "品牌",
            dataIndex: "pp"
        },
        {
            title: "数量",
            dataIndex: "sldw"
        },
        {
            title: "价格",
            dataIndex: "hsdj"
        },
        {
            title: "报价时间",
            dataIndex: "bjrq"
        },
        {
            title: "备注",
            dataIndex: "bjbz"
        },

    ];
    const data = [];
    export default {
        data() {
            return {
                loading: true,
                data,
                columns,
            };
        },

        methods: {
            //关闭弹出框
            close() {
                this.$store.state.bjlstk = false
            },
            //报价历史
            handleChangelist() {
                this.axios
                    .post(
                        "baojia/BaojiaHistory.php",
                        qs.stringify({
                            phone: this.$store.state.bbl_phone,
                            xjxh: this.$store.state.xjxh
                        })
                    )
                    .then(res => {
                        console.log(res);
                        this.loading = false;
                        if (res.data.code == 303) {
                            this.data = res.data.result;
                          
                            for (var i = 0; i < res.data.result.length; i++) {
                                this.data[i].key = res.data.result[i].id_num;
                            }
                        } else {
                            this.data = [];
                        }
                    });
            },

        },

        created() {
            this.handleChangelist();
        }
    };
</script>

<style lang='less'>
    .bjtk {
        position: absolute;
        z-index: 9999;
        width: 90%;
        height: auto;
        background-color: #fff;
        text-align: left;
        padding: 20px;
        top: 77px;
        left: 152px;

        .bjtk_list {
            .head {
                display: flex;
                justify-content: space-between;
            }

            .editable-cell {
                position: relative;
            }

            .editable-cell-input-wrapper,
            .editable-cell-text-wrapper {
                padding-right: 24px;
            }

            .editable-cell-text-wrapper {
                padding: 5px 24px 5px 5px;
            }

            .editable-cell-icon,
            .editable-cell-icon-check {
                position: absolute;
                right: 0;
                width: 20px;
                cursor: pointer;
            }

            .editable-cell-icon {
                line-height: 18px;
                display: none;
            }

            .editable-cell-icon-check {
                line-height: 28px;
            }

            .editable-cell:hover .editable-cell-icon {
                display: inline-block;
            }

            .editable-cell-icon:hover,
            .editable-cell-icon-check:hover {
                color: #108ee9;
            }

            .editable-add-btn {
                margin-bottom: 8px;
            }
        }
    }
</style>
